package com.shu.logsearch.common.sys.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.shu.logsearch.common.annotation.BaseViewDirectory;
import com.shu.logsearch.common.base.BaseController;
import com.shu.logsearch.common.sys.dto.SysUserDto;
import com.shu.logsearch.common.sys.model.SysUser;
import com.shu.logsearch.common.sys.service.SysUserService;
import com.shu.logsearch.common.web.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Tree Cai
 * @date 2019/7/16
 */
@Controller
@RequestMapping("/sys/user")
@BaseViewDirectory("/sys/user")
public class SysUserController extends BaseController<SysUser, SysUserService> {

    @RequestMapping("/list")
    @ResponseBody
    public Result list(SysUserDto sysUserDto) {
        Page pages = PageHelper.startPage(sysUserDto.getPageNum(), sysUserDto.getPageSize());
        service.list(new QueryWrapper<>());
        return Result.PAGE(pages);
    }
}
